add_namespace = britain 

# Tizard mission event for USA
country_event = {
	id = britain.1
	title = britain.1.t
	desc = britain.1.d
	picture = GFX_report_event_physics_lab_01
	
	is_triggered_only = yes
	
	option = {
		name = britain.1.a	#sounds good
		ai_chance = { factor = 90 }
		add_political_power = -10
		ENG = {
			country_event = { days = 1 id = britain.2 }
			add_opinion_modifier = {
				target = ROOT
				modifier = tizard_relations
			}
		}
		add_tech_bonus = {
			name = tizard_mission_focus
			uses = 1
			bonus = 1.0
			category = light_fighter
		}
		add_tech_bonus = {
			name = tizard_mission_focus
			bonus = 1.0
			uses = 2
			category = radar_tech
		}
	}
	
	option = {
		name = britain.1.b	#no way 
		ai_chance = { factor = 10 }
		#add_opinion_modifier = { target = ENG modifier = tizard_refused }
		ENG = {
			country_event = { days = 1 id = britain.3 }
		}
	}

	option = {
		name = britain.1.c	#tech_sharing
		trigger = { has_dlc = "Together for Victory"}
		ai_chance = { factor = 90 }
		add_political_power = -10
		ENG = {
			country_event = { days = 1 id = britain.21 }
			add_opinion_modifier = {
				target = ROOT
				modifier = tizard_relations
			}
		}
		add_to_tech_sharing_group = tizard_mission
	}
}

# USA helps
country_event = {
	id = britain.2
	title = britain.2.t
	desc = britain.2.d
	picture = GFX_report_event_physics_lab_02

	is_triggered_only = yes
	
	option = {
		name = britain.2.a
		add_tech_bonus = {
			name = tizard_mission_focus
			bonus = 1.0
			category = light_fighter
		}
		add_tech_bonus = {
			name = tizard_mission_focus
			bonus = 1.0
			uses = 2
			category = radar_tech
		}
		USA = {
			add_opinion_modifier = { target = ENG modifier = tizard_relations }
		}
	}
}

# USA says no
country_event = {
	id = britain.3
	title = britain.3.t
	desc = britain.3.d
	picture = GFX_report_event_physics_lab_01

	is_triggered_only = yes
	
	option = {
		name = britain.3.a
		add_opinion_modifier = { target = USA modifier = tizard_refused }
	}
}

# Burma road china
country_event = {
	id = britain.4
	title = britain.4.t
	desc = britain.4.d
	picture = GFX_report_event_burma_road

	is_triggered_only = yes
	
	option = {
		name = britain.4.a
	}
}

# Burma road yunnan
country_event = {
	id = britain.5
	title = britain.4.t
	desc = britain.4.d
	picture = GFX_report_event_burma_road

	is_triggered_only = yes
	
	option = {
		name = britain.4.a
	}
}

#Time for India to be free
country_event = {
	id = britain.6
	title = britain.6.t
	desc = britain.6.d
	picture = GFX_report_event_ghandi_women

	trigger = {
		tag = ENG
		has_global_flag = indian_independence_promised
		NOT = { has_idea = indian_independence_promised_idea }
		RAJ = { is_puppet_of = ENG }
	}
	
	mean_time_to_happen = {
		days = 30
	}
	
	option = {
		name = britain.6.a
		end_puppet = RAJ
	}
	option = {
		name = britain.6.b
		RAJ = {
			add_stability = -0.3
			add_war_support = -0.2
		}
	}
}

#End trade with Germany event for SWE/NOR
country_event = {
	id = britain.7
	title = britain.7.t
	desc = britain.7.d
	picture = GFX_report_event_merchant_ship_01

	is_triggered_only = yes

	
	option = {
		name = britain.7.a
		ai_chance = { factor = 60 }
		GER = {
				add_opinion_modifier = { target = ROOT modifier = embargo } 
			}
	}
	option = {
		name = britain.7.b
		ai_chance = { factor = 40 }
		ENG = {
			country_event = britain.8
		}
	}
}

country_event = {
	id = britain.8
	title = britain.8.t
	desc = britain.8.d
	picture = GFX_report_event_merchant_ship_01

	is_triggered_only = yes
	
	option = {
		name = britain.8.a
		ai_chance = { factor = 70 }
		create_wargoal = {
				type = take_state
				target = FROM
				generator = owned_states
			}
		if = {
			limit = {
				USA = {
					NOT = {
						has_opinion_modifier = unprovoked_aggression
					}
				}
			}
			USA = {
				add_opinion_modifier = { target = ROOT modifier = unprovoked_aggression }
			}
		}
	}
	option = {
		name = britain.8.b
		ai_chance = { factor = 30 }
	}
}

# Chamberlain Resigns
country_event = {
	id = britain.9
	title = britain.9.t
	desc = britain.9.d
	picture = GFX_report_event_chamberlain

	fire_only_once = yes

	trigger = {
		tag = ENG
		has_war = yes
		has_government = democratic
		NOT = {
			has_completed_focus = uk_scandinavian_focus
		}
		POL = { has_capitulated = yes }
		OR = {
			has_global_flag = fall_of_france
			FRA = { surrender_progress > 0.1 }
			HOL = { surrender_progress > 0.1 }
			BEL = { surrender_progress > 0.1 }
			LUX = { surrender_progress > 0.1 }
			DEN = { surrender_progress > 0.1 }
			NOR = { surrender_progress > 0.1 }
			AND = {
				110 = { is_controlled_by = GER }
				NOT = { is_in_faction_with = GER }
			}
		}
		NOT = { has_country_flag = chamberlain_died }
		has_country_leader = {
			character = ENG_neville_chamberlain
			ruling_only = yes
		}
	}

	mean_time_to_happen = {
		days = 2
	}

	immediate = { set_country_flag = chamberlain_resigned }
	
	option = {
		name = britain.9.a
		promote_character = ENG_winston_churchill
		retire_character = ENG_neville_chamberlain
		add_stability = 0.1
		add_war_support = 0.1

	}
}


# Chamberlain Passes Away
country_event = {
	id = britain.10
	title = britain.10.t
	desc = britain.10.d
	picture = GFX_report_event_chamberlain

	fire_only_once = yes

	trigger = {
		tag = ENG
		has_government = democratic
		date > 1940.9.11
		NOT = { has_country_flag = chamberlain_resigned }
		has_country_leader = {
			character = ENG_neville_chamberlain
			ruling_only = yes
		}
	}	

	mean_time_to_happen = {
		days = 30
	}
	
	immediate = { set_country_flag = chamberlain_died }

	option = {
		name = britain.10.a
		kill_country_leader = yes
		create_country_leader = {
			name = "Winston Churchill"
			desc = "POLITICS_WINSTON_CHURCHILL_DESC"
			picture = "Portrait_Britain_Winston_Churchill.dds"
			expire = "1965.1.1"
			ideology = conservatism
			traits = {
				british_bulldog
			}
		}
	}
	option = {
		name = britain.10.b
		kill_country_leader = yes
		create_country_leader = {
			name = "Lord Edward Halifax"
			desc = "POLITICS_EDWARD_HALIFAX_DESC"
			picture = "Portrait_Britain_Edward_Halifax.dds"
			expire = "1965.1.1"
			ideology = conservatism
			traits = {
				
			}
		}
	}
}

# React to Rise of the CommieNazis 
country_event = {
	id = britain.11
	title = britain.11.t
	desc = britain.11.d
	picture = GFX_report_event_molotov_ribentrop_handshake

	is_triggered_only = yes
	trigger = {
		is_faction_leader = yes
	}
	
	option = {
		name = britain.11.a
		add_war_support = 0.1
		every_other_country = {
				limit = {
					NOT = { has_war_with = ENG }
					is_in_faction = no
					has_government = democratic
					is_puppet = no
					OR = {
						capital_scope = {
								is_on_continent = europe
						}
						capital_scope = {
								is_on_continent = asia
						}
						num_of_factories > 30
					}
				}
				country_event = britain.12
			}
	}
	
	option = {
		name = britain.11.b
		ai_chance = { factor = 0 }
	}
}

# React to British call
country_event = {
	id = britain.12
	title = britain.12.t
	desc = britain.12.d
	picture = GFX_report_event_molotov_ribentrop_handshake

	is_triggered_only = yes
	
	option = {
		name = britain.12.a
		add_war_support = 0.1 #glorious crusade to free Europe from commienazi menace
		ENG = { add_to_faction = ROOT }
		ROOT = {
			add_ai_strategy = {
				type = alliance
				id = "ENG"
				value = 200
			}
		}
	}
	
	option = {
		name = britain.12.b
		ai_chance = { factor = 0 }
	}
}

# France wants to join allies
country_event = {
	id = britain.13
	title = britain.13.t
	desc = britain.13.d
	picture = GFX_report_event_degaulle_churchill

	is_triggered_only = yes
	
	option = {
		name = britain.13.a
		add_to_faction = FROM
		FROM = {
			add_ai_strategy = {
				type = alliance
				id = "ENG"
				value = 200
			}
		}
		FROM = { country_event = { id = france.29} }
		hidden_effect = {
			news_event = { id = news.175 }
		}
	}
	
	option = {
		name = britain.13.b
		ai_chance = { factor = 0 }
		FROM = { 
			add_opinion_modifier = {
				target = ROOT
				modifier = FRA_go_with_britain_reject
			}
			country_event = { id = france.30 }
		}
		hidden_effect = {
			news_event = { id = news.176 }
		}
	}
}

# Germany demands Slovenia from Yugoslavia
country_event = {
	id = britain.14
	title = britain.14.t
	desc = britain.14.d
	picture = GFX_report_event_hitler_croatia_handshake

	is_triggered_only = yes
	
	option = { # Abandon Yugoalvia
		name = britain.14.a
		ai_chance = { 
			factor = 90 
			modifier = {
				has_war_with = GER
				factor = 0
			}
		}
		YUG = {
			add_opinion_modifier = { target = ENG modifier = western_betrayal }
		}		
		if = {
			limit = {
				has_guaranteed = YUG
			}
			diplomatic_relation = {
   				country = YUG
   				relation = guarantee
   				active = no
  			}
		}
		if = {
			limit = {
				country_exists = FRA
			}
			FRA = { country_event = { id = france.25 hours = 2 } }
		}
		else = {
			if = {
				limit = {
					ITA = {
						OR = {
							NOT = { has_completed_focus = ITA_yugoslavia_friend }						
							is_in_faction_with = GER
							exists = no
						}
					}
				}
				YUG = {
					add_opinion_modifier = { target = FRA modifier = western_betrayal }
					country_event = { id = yugoslavia.5 hours = 6 }
				}			
			}
			if = {
				limit = { 
					ITA = {
						has_completed_focus = ITA_yugoslavia_friend
						NOT = { is_in_faction_with = GER }
						NOT = { has_war_with = YUG }
					}
				}
				ITA = { country_event = { id = italy.12 } }
			}
		}
	}
	
	option = { # Support Yugoslavia
		name = britain.14.b
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				is_in_faction_with = GER
			}
		}
		if = {
			limit = {
				is_in_faction_with = GER
				is_faction_leader = yes
			}
			remove_from_faction = GER
		}
		if = {
			limit = {
				is_in_faction_with = GER
				is_faction_leader = no
			}
			GER = { remove_from_faction = ENG }
		}
		add_political_power = -200
		add_stability = -0.05
		add_opinion_modifier = { target = GER modifier = condemn_aggression }
		effect_tooltip = {
			GER = {
				create_wargoal = {
					type = take_state_focus
					target = YUG
					generator = { 102 }
				}
			}
		}
		add_to_faction = YUG
		YUG = {
			add_ai_strategy = {
				type = alliance
				id = "ENG"
				value = 200
			}
		}
		if = {
			limit = {
				FRA = {
					is_puppet = no
					NOT = { has_war_with = YUG }
				}
			}
			FRA = { country_event = { id = france.26 hours = 2 } }
		}
		YUG = {
			add_opinion_modifier = { target = ENG modifier = offered_support }
		}
	}	
}

# France leaves the Allies
country_event = {
	id = britain.15
	title = britain.15.t
	desc = britain.15.d
	picture = GFX_report_event_french_british_officers
	
	is_triggered_only = yes
	
	option = {
		name = britain.15.a
		FRA = {
			add_opinion_modifier = { target = ENG modifier = abandoned_yugoslavia }
		}
	}
}

# King dies
country_event = {
	id = britain.16
	title = britain.16.t
	desc = britain.16.d
	picture = GFX_report_event_europe_funeral
	
	trigger = {
		tag = ENG
		date > 1936.1.19
		has_start_date < 1936.01.02
	}	

	fire_only_once = yes

	mean_time_to_happen = { days = 7 }

	immediate = {
		hidden_effect = {
			set_country_flag = ENG_king_died
			remove_ideas = george_v
			add_ideas = ENG_king_edward
		}		
	}
	
	option = {
		name = britain.16.a
		effect_tooltip = {
			remove_ideas = george_v		
			add_ideas = ENG_king_edward
		}
	}
}

# King abdicates
country_event = {
	id = britain.17
	title = britain.17.t
	desc = britain.17.d
	picture = GFX_report_event_generic_sign_treaty2
	
	trigger = {
		tag = ENG
		has_country_flag = ENG_king_died
		date > 1936.12.1
		NOT = { has_dlc = "Man the Guns" }
	}
	
	fire_only_once = yes

	mean_time_to_happen = { days = 14 }
	
	immediate = {
		hidden_effect = {
			remove_ideas = ENG_king_edward
			add_ideas = ENG_george_vi		
		}
	}

	option = {
		name = britain.17.a
		effect_tooltip = {
			remove_ideas = ENG_king_edward
			add_ideas = ENG_george_vi		
		}
	}
}

# Return of the Nazi King
country_event = {
	id = britain.18
	title = britain.18.t
	desc = britain.18.d
	picture = GFX_report_event_fascist_gathering
	
	trigger = {
		tag = ENG
		has_idea = ENG_george_vi
		has_government = fascism
		NOT = { has_dlc = "Man the Guns" }
	}
	
	fire_only_once = yes

	mean_time_to_happen = { days = 14 }
	
	immediate = {
		hidden_effect = {
			remove_ideas = ENG_george_vi		
		}
	}

	option = {
		name = britain.18.a
		effect_tooltip = {
			remove_ideas = ENG_george_vi	
		}
		create_country_leader = {
			name = "Edward VIII"
			desc = "POLITICS_EDWARD_EDWARD_DESC"
			picture = "Portrait_Britain_Edward_VIII.dds"
			expire = "1965.1.1"
			ideology = fascism_ideology
			traits = {
				inexperienced_imperialist				
			}
		}
	}

	option = {
		name = britain.18.b	
		effect_tooltip = {
			remove_ideas = ENG_george_vi	
		}
		add_ideas = ENG_king_edward_fascism
	}
}

#Britain receives warning of the Indian National Army
country_event = {
	id = britain.19
	title = britain.19.t
	desc = britain.19.d
	picture = GFX_report_event_indian_soldiers

	is_triggered_only = yes

	option = {
		name = britain.19.a
		effect_tooltip = {
			RAJ = {
				add_ideas = RAJ_azad_hind
			}
		}
		custom_effect_tooltip = ENG_RAJ_azad_hind_tooltip 
		hidden_effect = {
			country_event = { id = britain.20 days = 500  random_days = 100 }
		}
	}
}


#Free India Government Leads Revolt
country_event = {
	id = britain.20
	title = britain.20.t
	desc = britain.20.d
	picture = GFX_report_event_indian_soldiers

	is_triggered_only = yes

	trigger = {
		NOT = {
			has_completed_focus = uk_free_india_focus
		}
		RAJ = {
			is_puppet_of = ENG
			fascism > 0.3
			has_civil_war = no
		}
	}

	option = {
		name = britain.20.a
		hidden_effect = {
			if = {
				limit = {
					RAJ = {
						has_idea = RAJ_azad_hind
					}
				}
				RAJ = {
					remove_ideas = RAJ_azad_hind
				}
			}
		}
		if = {
			limit = {
				NOT = {
					RAJ = {
						has_government = fascism
					}
				}
			}
			RAJ = {
				country_event = { id = britain.23 }
			}
		}
		
		if = {
			limit = {
				RAJ = {
					has_government = fascism
				}
			}
			end_puppet = RAJ
			if = {
				limit = {
					RAJ = {
						is_in_faction_with = ENG
					}
				}
				remove_from_faction = RAJ
			}
			create_wargoal = {
				type = puppet_wargoal_focus
				target = RAJ
			}
		}
	}

}

country_event = {
	id = britain.21
	title = britain.21.t
	desc = britain.21.d
	picture = GFX_report_event_physics_lab_02

	is_triggered_only = yes
	
	option = {
		name = britain.21.a
		add_to_tech_sharing_group = tizard_mission
		USA = {
			add_opinion_modifier = { target = ENG modifier = tizard_relations }
		}
	}
}

# Stanley Baldwin Resigns
country_event = {
    id = britain.22
    title = britain.22.t
    desc = britain.22.d
    picture = GFX_report_event_royal_parade
 
    fire_only_once = yes
 
    trigger = {
        original_tag = ENG
        has_government = democratic
        has_idea = ENG_george_vi
        date > 1937.5.27
        has_start_date < 1936.01.02
        NOT = { has_country_flag = baldwin_resigned }
    }

    mean_time_to_happen = {
        days = 7
    }

    option = {
        name = britain.22.a
        retire_country_leader = yes
        create_country_leader = {
        	name = "Neville Chamberlain"
        	desc = "POLITICS_NEVILLE_CHAMBERLAIN_DESC"
        	picture = "Portrait_Britain_Neville_Chamberlain.dds"
        	expire = "1965.1.1"
        	ideology = conservatism
        	traits = {
        		chamberlain_appeaser rearmer
        	}
        }
        set_country_flag = baldwin_resigned
      }
}

#RAJ gets to choose sides in Indian civil war
country_event = {
	id = britain.23
	title = britain.23.t
	desc = britain.23.d
	picture = GFX_report_event_indian_soldiers

	is_triggered_only = yes
	
	#side with government
	option = {
		ai_chance = {
			factor = 100
			modifier = {
				has_government = fascism
				factor = 0
			}
		}
		name = britain.23.a
		start_civil_war = {
				ideology = fascism
				size = 0.5
		}
	}
	#side with fascists
	option = {
		name = britain.23.b
		start_civil_war = {
				ruling_party = fascism
				ideology = neutrality
				size = 0.5
		}
		random_other_country = {
			limit = {
				original_tag = RAJ
				has_government = neutrality
				is_puppet_of = ENG
			}
			set_cosmetic_tag = RAJ_UK
		}
	}
}

# Shadow Scheme Factories
country_event = {
    id = britain.24
    title = britain.24.t
    desc = britain.24.d
    picture = GFX_report_event_generic_factory
 
    fire_only_once = yes
 
    trigger = {
        original_tag = ENG
        has_completed_focus = shadow_scheme_focus
        has_war = yes
    }

    mean_time_to_happen = {
        days = 7
    }

    option = {
        name = britain.24.a
        random_owned_controlled_state = {
			limit = {
				is_in_home_area = yes
				free_building_slots = {
					building = arms_factory
					size > 1
					include_locked = yes
				}
			}
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = arms_factory
				level = 2
				instant_build = yes
			}
			set_state_flag = shadow_scheme_2AF
		}
		random_owned_controlled_state = {
			limit = {
				is_in_home_area = yes
				free_building_slots = {
					building = arms_factory
					size > 1
					include_locked = yes
				}
			}
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = arms_factory
				level = 2
				instant_build = yes
			}
			set_state_flag = shadow_scheme_2AF
		}
    }
}